<template>
	<view>
		<view class="content">
			<!-- 参考uview的CountDown -->
			<view class="CountDown" > 倒计时 </view>
			<u-count-down :timestamp="time" :show-days="false" :show-hours="true" separator="colon" separator-size="0" separator-color="#1aa034" bg-color="#1aa034" color="#ffffff" font-size="58"></u-count-down>
			
			<u-button @click="subs">vuex</u-button>
			
		</view>
		
	</view>
</template>

<script>
	//测试vuex
	import {mapState,mapMutations } from 'vuex' 
	export default {
		data() {
			return {
				time:''
			}
		},
		onLoad() {
			console.log(this.name)
			let timer=24*60*60
			this.time=parseInt(timer)
			
		},
		methods: {
			...mapMutations(['sub']),
			subs(){
				this.sub()
				console.log(this.name)
			}	
		},
		computed:{
			    ...mapState(['name']) 
		}
	}
</script>

<style lang="scss">
	.content{
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		.CountDown{
			
			margin-top: 400rpx;
			margin-bottom: 20rpx;
			font-size: 48rpx;
			font-weight: 600rpx;
		}
		
		
		
	}


</style>
